package com.zqq.demo.net

import android.util.Log
import com.bl.base.http.HttpCreater
import com.zqq.demo.BuildConfig
import com.zqq.lib_net.BaseNetRepository
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow

class Repository:BaseNetRepository() {
    val service by lazy { HttpCreater.instance.getRetrofit(BuildConfig.baseUrl).create(Api::class.java) }

    companion object{
        val instance by lazy { Repository() }
    }

    fun getList(): Flow<String> = flow {
        val result = service.getList(0)
        Log.i("zq_demo","flow  result>>${result}")
        emit(result)
    }
}